package com.le.tester.leetcode;

/**
 * 描述：元素移除(使用拷贝覆盖)
 */
public class ElementRemoved {
    private int removeElement(int[] nums, int val) {
        if (nums == null || nums.length == 0) {
            return 0;
        }
        int result = 0;
        for (int num : nums) {
            if (val != num) {
                nums[result] = num;
                result++;
            }
        }
        return result;
    }

}
